package exer;

/**
 * @author shkstart
 * @create 2022-08-15-19:59
 */
public class Num141 {
    public boolean hasCycle(ListNode head) {

        ListNode low = head;
        ListNode fast = head;
        while (fast!=null&&fast.next!=null) {
            low=low.next;
            fast=fast.next.next;
            if (low == fast) {
                return true;
            }

        }
        return false;



    }
}
